package cn.easy.kitchen.repository;

import cn.easy.kitchen.domain.MaterialBase;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

public interface MaterialBaseDao extends PagingAndSortingRepository<MaterialBase, String>, JpaSpecificationExecutor<MaterialBase> {

    List<MaterialBase> findByNo(String no);

    List<MaterialBase> findByOldNo(String oldNo);

    @Query("SELECT count(id) FROM MaterialBase")
    int countMaterial();
}
